import data
import requests
class Marketing:
    #todo Marketing
        def goods_coupon_select(self):
            """优惠券查询"""
            data = {
                "method": "GET",
                "url": "http://124.70.39.201/adminapi/shop/goods/coupon",
                "headers": {'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJpc3MiOiIxMjQuNzAuMzkuMjAxIiwiYXVkIjoiMTI0LjcwLjM5LjIwMSIsImlhdCI6MTc0MTk0MzYwMywibmJmIjoxNzQxOTQzNjAzLCJleHAiOjE3NDI1NDg0MDMsImp0aSI6IjFfYWRtaW4ifQ.4D-oPDio2xjXNJRyi2gWTJCNStopaX7cErAU9RFUOPk',},
            }
            return requests.request(**data).json()
        def goods_coupon_add(self):
            """添加优惠券"""
            data = {
                "method": "POST",
                "url": "http://124.70.39.201/adminapi/shop/goods/coupon",
                "headers": {
                'Content-Type': 'application/json',
                'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJpc3MiOiIxMjQuNzAuMzkuMjAxIiwiYXVkIjoiMTI0LjcwLjM5LjIwMSIsImlhdCI6MTc0MTk0MzYwMywibmJmIjoxNzQxOTQzNjAzLCJleHAiOjE3NDI1NDg0MDMsImp0aSI6IjFfYWRtaW4ifQ.4D-oPDio2xjXNJRyi2gWTJCNStopaX7cErAU9RFUOPk',
                },
                "json": { 'title': '美团神券',
                'price': '5',
                'type': 1,
                'limit': 2,
                'receive_type': 1,
                'remain_count': 1000,
                'threshold': 2,
                'limit_count': 1,
                'min_condition_money': 1,
                'length': 30,
                'receive_type_time': 2,
                'valid_type': 1,
                'receive_time': [
                    '2025-03-15T03:05:59.609Z',
                    '2025-04-14T03:05:59.609Z',
                ],
                'valid_time': '2025-04-14T03:05:59.609Z',}
            }
            return requests.request(**data).json()
        def goods_coupon_edit(self):
            """优惠券编辑"""
            data = {
                "method": "PUT",
                "url": "http://124.70.39.201/adminapi/shop/goods/coupon/edit/72",
                "headers": {
                    'Content-Type': 'application/json',
                    'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJpc3MiOiIxMjQuNzAuMzkuMjAxIiwiYXVkIjoiMTI0LjcwLjM5LjIwMSIsImlhdCI6MTc0MTk0MzYwMywibmJmIjoxNzQxOTQzNjAzLCJleHAiOjE3NDI1NDg0MDMsImp0aSI6IjFfYWRtaW4ifQ.4D-oPDio2xjXNJRyi2gWTJCNStopaX7cErAU9RFUOPk'
                },
                "json": {'title': '美团大神券',
                'price': '10',
                'type': 1,
                'limit': 2,
                'receive_type': 1,
                'remain_count': 1000,
                'threshold': 2,
                'limit_count': 1,
                'min_condition_money': '0.00',
                'length': 30,
                'receive_type_time': 2,
                'valid_type': 1,
                'receive_time': [
                    '2025-03-15T06:17:57.901Z',
                    '2025-04-14T06:17:57.901Z',
                ],
                'valid_time': '2025-04-14 11:05:59',
                'id': 72,
                'start_time': 0,
                'end_time': 0,
                'receive_count': 0,
                'status': 1,
                'create_time': '2025-03-15 11:07:11',
                'valid_start_time': '2025-03-15 11:07:11',
                'valid_end_time': '2025-04-14 11:05:59',
                'sort': 0,
                'receive_status': 1,
                'sum_count': '不限量',
                'receive_use_count': 0,
                'receive_expire_count': 0},
            }
            return requests.request(**data).json()
        def goods_coupon_invalid(self):
            """优惠券关闭"""
            data = {
                "method": "PUT",
                "url": "http://124.70.39.201/adminapi/shop/goods/coupon/invalid/47",
                "headers": {
                    'Content-Type': 'application/json',
                    'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJpc3MiOiIxMjQuNzAuMzkuMjAxIiwiYXVkIjoiMTI0LjcwLjM5LjIwMSIsImlhdCI6MTc0MTk0MzYwMywibmJmIjoxNzQxOTQzNjAzLCJleHAiOjE3NDI1NDg0MDMsImp0aSI6IjFfYWRtaW4ifQ.4D-oPDio2xjXNJRyi2gWTJCNStopaX7cErAU9RFUOPk'
                },
                "json": {'showSuccessMessage': True,},
            }
            return requests.request(**data).json()
        def goods_coupon_del(self):
            """优惠券删除"""
            data = {
                "method": "DELETE",
                "url": "'http://124.70.39.201/adminapi/shop/goods/coupon/47",
                "headers": {
                    'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJpc3MiOiIxMjQuNzAuMzkuMjAxIiwiYXVkIjoiMTI0LjcwLjM5LjIwMSIsImlhdCI6MTc0MTk0MzYwMywibmJmIjoxNzQxOTQzNjAzLCJleHAiOjE3NDI1NDg0MDMsImp0aSI6IjFfYWRtaW4ifQ.4D-oPDio2xjXNJRyi2gWTJCNStopaX7cErAU9RFUOPk'},
            }
            return requests.request(**data).json()
        def goods_coupon_records(self):
            """优惠券领取查询"""
            data = {
                "method": "GET",
                "url": "http://124.70.39.201/adminapi/shop/goods/coupon/detail/72",
                "headers": {'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJpc3MiOiIxMjQuNzAuMzkuMjAxIiwiYXVkIjoiMTI0LjcwLjM5LjIwMSIsImlhdCI6MTc0MTk0MzYwMywibmJmIjoxNzQxOTQzNjAzLCJleHAiOjE3NDI1NDg0MDMsImp0aSI6IjFfYWRtaW4ifQ.4D-oPDio2xjXNJRyi2gWTJCNStopaX7cErAU9RFUOPk'},
            }
            return requests.request(**data).json()
        def goods_coupon_detail(self):
            """优惠券详情"""
            data = {
                "method": "",
                "url": "",
                "headers": {},
                "json": {},
            }
            return requests.request(**data).json()
if __name__ == '__main__':
    obj = Marketing()
    print(obj.goods_coupon_add())